package com.yootk.config.mapper;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;

import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter;
import java.util.TimeZone;

public class CustomObjectMapper extends ObjectMapper {
    private static final String LOCAL_DATE_FORMAT ="yyyy-MM-dd" ;
    public CustomObjectMapper(){
        super.setDateFormat(new SimpleDateFormat(LOCAL_DATE_FORMAT));
        super.configure(SerializationFeature.INDENT_OUTPUT,true) ;
        super.setSerializationInclusion(JsonInclude.Include.NON_NULL) ;
        super.setTimeZone(TimeZone.getTimeZone("GMT+8:00")) ;

    }
}
